import Vue from "vue";
import App from "./App.vue";
import store from "./store";
import axios from "axios";

import {
  Tree,
  Dropdown,
  DropdownMenu,
  DropdownItem,
  Input,
  Select,
  Tabs,
  TabPane,
  Collapse,
  CollapseItem,
  Slider,
  Option,
  Tooltip,
  Dialog,
  Form,
  FormItem,
  Switch,
  Radio,
  RadioGroup,
  RadioButton,
  Upload,
  Button,
  MessageBox,
  Message,
  Loading,
  ColorPicker,
  Table,
  TableColumn,
  InfiniteScroll,
  DatePicker,
  Progress
} from 'element-ui';
//默认皮肤
import 'element-ui/lib/theme-chalk/index.css';
//自定义皮肤
// import '@/theme/index.css'

Vue.config.productionTip = false;

import moment from "moment";
import "moment/locale/zh-cn";
moment.locale("zh-cn");


Vue.use(Tree);
Vue.use(Dropdown);
Vue.use(DropdownMenu);
Vue.use(DropdownItem);
Vue.use(Input);
Vue.use(Select);
Vue.use(Tabs);
Vue.use(TabPane);
Vue.use(Collapse);
Vue.use(CollapseItem);
Vue.use(Slider);
Vue.use(Option);
Vue.use(Tooltip);
Vue.use(Dialog);
Vue.use(Form);
Vue.use(FormItem);
Vue.use(Switch);
Vue.use(Radio);
Vue.use(RadioGroup);
Vue.use(RadioButton);
Vue.use(Upload);
Vue.use(Button);
Vue.use(ColorPicker);
Vue.use(Table);
Vue.use(TableColumn);
Vue.use(InfiniteScroll);
Vue.use(DatePicker);
Vue.use(Progress);

Vue.prototype.$moment = moment;
Vue.prototype.$message = Message
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
Vue.prototype.$confirm = MessageBox.confirm;
Vue.prototype.$prompt = MessageBox.prompt;
Vue.prototype.$loading = Loading.service
// Vue.prototype.API = API
Vue.prototype.axios = axios

//创建全局 event bus
var EventBus = new Vue();
Object.defineProperties(Vue.prototype, {
  $bus: {
    get: function () {
      return EventBus;
    }
  }
})


new Vue({
  store,
  render: h => h(App)
}).$mount("#app");
